package com.my.fp.list;

import com.my.bean.User;
import com.my.utils.Utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: marshal
 * @date: 2021-10-08 10:03 AM
 */
public class ListTest {
    public static void main(String[] args) {
        List<User> users = Utils.getUsers();
        User user = users.stream().filter(e -> e.getAge() == 18).findAny().orElse(null);
        System.out.println(user);
        List<Integer> l = new ArrayList<>();
        System.out.println(l.stream().filter(e -> e > 10).findFirst().orElse(0));
    }
}
